package fruitshopmall.Controller;


import fruitshopmall.Entity.OrderDetail;
import fruitshopmall.Entity.Result;
import fruitshopmall.Service.OrderDetailService;
import fruitshopmall.utils.Pager;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

/**
 * 订单详情c层
 */
@Controller
@RequestMapping("/orderDetail")
public class OrderDetailController {

    @Autowired
    private OrderDetailService orderDetailService;
    /**
     * 订单详情c层
     */
    @RequestMapping("/searchGoodDetailById")
    @ResponseBody
    public Result ulist(OrderDetail orderDetail){
        //分页查询
        String sql = "select * from order_detail  where order_id="+orderDetail.getOrderId();
        Pager<OrderDetail> pagers = orderDetailService.findBySqlRerturnEntity(sql);
        Result rs = new Result<List>(20000,pagers.getDatas());
        return rs;
    }
}
